home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4668 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.0 KB  |  38 lines

  1. Path: news.uni-jena.de!news
  2. From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs)
  3. Newsgroups: comp.lang.c++
  4. Subject: DEC Compiler error
  5. Date: 31 Jan 1996 15:15:05 GMT
  6. Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena
  7. Message-ID: <4eo11p$qlr@fsuj01.rz.uni-jena.de>
  8. Reply-To: mkt@isun04.inf.uni-jena.de
  9. NNTP-Posting-Host: isun07.inf.uni-jena.de
  10.  
  11. In older DEC C++ Compilers (cxx for all Alpha systems) there is
  12. a strange error. (I think the latest version is clean.)
  13.  
  14. class X {
  15.         struct Y {};  // nested class
  16.         Y f();      // function returning object of nested class
  17. };
  18.  
  19. X::Y X::f() {       // member function definition
  20.                     // DEC cxx: X::Y is not accessable
  21.         return Y();
  22. }
  23.  
  24. The error message 'X::Y is not accessable' is simply an error by the
  25. DEC Compiler.
  26. Here is the proof:
  27.  
  28. class X {
  29.         struct Y {};
  30.         Y f() { return Y(); }
  31. };
  32.  
  33. This code compiles without error message! But where is the difference?
  34.  
  35. But, as stated before, the latest version of the compiler seem to run correct.
  36.  
  37.  
  38.